// pages/component/bingtu/index.js
let CHARTS = require('../../../utils/dist_wxcharts.js');
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {

  },
  lifetimes: {
    attached: function () {
      this.myPie()
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    myPie: function () {
      let data = [{
        name: '一班',
        data: 32
      }, {
        name: '二班',
        data: 30
      }, {
        name: '三班',
        data: 20
      }]
      new CHARTS({
        component: this,
        canvasId: 'canvas1',
        type: 'pie',
        series: data,
        width: 300,
        height: 300,
        dataLabel: true,
      });
    },

  }
})